
<!DOCTYPE HTML>
<html>
<head>
    <title>枣阳市第二人民医院信息管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/bui-min.css" rel="stylesheet" type="text/css" />
    <link href="assets/css/main-min.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="content">
    <div class="dl-main-nav">
        <div class="dl-inform"><div class="dl-inform-title"><s class="dl-inform-icon dl-up"></s></div></div>
        <ul id="J_Nav"  class="nav-list ks-clear" style="float:left">
            <!--<li class="nav-item dl-selected"><div class="nav-item-inner nav-home">信息采编系统</div></li>-->
			<li style=" color:#fff; font-size:20px; margin-top:10px; margin-left:20px;">山东省第二人民医院管理平台</li>
		</ul>
		<div  style="float:right; color:#fff;">欢迎您，<span class="dl-log-user" id="trueName">张三</span><a onclick="logout()" title="退出系统" class="dl-log-quit">[退出]</a></div>
    </div>
	
    <ul id="J_NavContent" class="dl-tab-conten">
    </ul>
</div>
<script type="text/javascript" src="assets/js/jquery-1.6.js"></script>
<script type="text/javascript" src="assets/js/bui.js"></script>
<script type="text/javascript" src="assets/js/common/main-min.js"></script>
<script type="text/javascript" src="assets/js/config-min.js"></script>


<script>
    BUI.use('common/main',function(){
        let configTest = new Array();
        $(function () {
            $.getJSON("/user/getInfo",null,function (data) {
                if (data.msg=='success') {
                    console.log(data)
                    // 用户名的显示
                    $("#trueName").html(data.data.u_trueName)
                    // 封装菜单数据
                    let menuList = data.data.role.menuList;
                    let totalItems = new Array();
                    for (let i = 0; i < menuList.length; i++) {
                        if (menuList[i].m_state == 0){
                            let itemList = {id:menuList[i].m_id.toString(),text:menuList[i].m_name,href:menuList[i].m_url};
                            totalItems.push(itemList);
                        }
                    }
                    console.log("totalList")
                    console.log(totalItems)
                    let config = [
                        {id:'1',menu:[
                                {text:'快速通道',items: totalItems}
                            ]}
                    ];
                    new PageUtil.MainPage({
                        modulesConfig : config
                    });
                } else {
                    alert("权限不够！请登录")
                    location.href = "login.html";
                }
            })

        })
    });
    function logout() {
        $.getJSON("/user/logout",null,function (data) {
            if (data.msg=='success') {
                location.href = "login.html";
            } else {
                alert("网络问题，请重新")
            }
        })
    }
</script>
</body>
</html>